package com.yy.permissions_general.module.system.schedule.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 定时任务日志
 * </p>
 *
 * @author YY
 * @since 2022-02-09
 */
@Data
@TableName("schedule_log")
public class ScheduleLog extends Model<ScheduleLog> {

    private static final long serialVersionUID = 1L;

    /**
     * 任务日志id
     */
    @TableId(value = "log_id", type = IdType.ASSIGN_ID)
    private String logId;

    /**
     * 任务id
     */
    @TableField("job_id")
    private String jobId;

    /**
     * spring bean名称
     */
    @TableField("bean_name")
    private String beanName;

    /**
     * 参数
     */
    @TableField("params")
    private String params;

    /**
     * 任务状态    0：成功    1：失败
     */
    @TableField("status")
    private Integer status;

    /**
     * 失败信息
     */
    @TableField("error")
    private String error;

    /**
     * 耗时(单位：毫秒)
     */
    @TableField("times")
    private Integer times;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;


    @Override
    protected Serializable pkVal() {
        return this.logId;
    }

}
